import *  as z  from 'zod'

export const UserRegisterSchema = () => {
    return z.object({
        email: z.string().email(),
        password: z.string().min(6),
        name: z.string().min(3).max(20),
        agreePolicy: z.boolean(),
    })
}

export const UserLoginSchema = () => {
    return z.object({
        email: z.string().email(),
        password: z.string().min(6),
        rememberMe: z.boolean().optional().nullable(),
    })
}

export const UserPasswordChangeSchema = () => {
    return z.object({
        currentPassword: z.string().min(6),
        newPassword: z.string().min(6),
        confirmPassword: z.string().min(6)
      }).refine(data => data.newPassword === data.confirmPassword, {
        message: 'password.mismatch',
        path: ['confirmPassword']
      })
}
